package com.dynamic.model.dao.impl;

import com.dynamic.model.common.dao.impl.BaseDaoImpl;
import com.dynamic.model.model.po.RequestHead;

import com.dynamic.model.dao.RequestHeadDao;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 
 * @desc RequestHeadDao的接口实现类
 *
 * @author luwei
 * @Fri Aug 08 14:25:29 CST 2014
 */
@Repository
public class RequestHeadDaoImpl extends BaseDaoImpl<RequestHead> implements RequestHeadDao {

    @Override
    public List<RequestHead> getRequestListByUser(int userId) {
        String hql = "from RequestHead where creater = ? and deleteFlag=0" ;
        Query query = this.getSessionFactory().getCurrentSession().createQuery(hql);
        query.setParameter(0,userId);
        return query.list();
    }
}